package 装饰者.饮料里随便加调料;

// 调料：豆浆
public class Soy extends Decorator{
    public Soy(Drink drink) {
        super(drink);
        setDesc("花生");
        setPrice(3.0f);
    }

    @Override
    float cost() {
        //super.cost() 是 Milk.cost(),这里的drink是Milk对象
        return super.cost() + getPrice();
    }
}
